Skip to content

build: correct Jieba release license metadata#593

Merged
JingsongLi merged 2 commits into
apache:mainfrom
shyjsarah:fix/jieba-release-license
Jul 23, 2026
Merged

build: correct Jieba release license metadata#593
JingsongLi merged 2 commits into
apache:mainfrom
shyjsarah:fix/jieba-release-license

Conversation

@shyjsarah

Copy link
Copy Markdown
Contributor

Purpose

Linked issue: N/A (CI hotfix)

Fix release-license generation for Python artifacts after paimon-ftindex-core introduced the transitive jieba-rs and jieba-macros dependencies. Their crates.io packages do not include the workspace license file, so scripts/release_licenses.py --check rejects the unresolved generic MIT placeholder.

This extracts the focused legal-metadata fix from #591 and unblocks #571.

Brief change log

  • Add the verified upstream jieba-rs workspace MIT license and document its pinned source.
  • Add a repository-backed license correction for jieba-rs and jieba-macros.
  • Allow license corrections to cover multiple resolved versions of the same crate while requiring identical license text.
  • Add regression coverage for the Jieba correction, repository-backed licenses, duplicate crate versions, and legal-file registration.

Tests

  • uv run --python 3.11 --no-project python -m unittest discover -s scripts/tests -p "test_*.py"
  • cargo fetch --locked
  • python3 scripts/release_licenses.py --check — validated 21 generated binary legal files
  • cargo fmt --all -- --check
  • git diff --check

API and Format

No public API or storage-format changes.

Documentation

Update third-party-licenses/README.md with the pinned upstream source for the Jieba workspace license.

Use the verified jieba-rs workspace license for generated Python artifact reports and support duplicate corrected crate versions.

Co-authored-by: Dapeng Sun <sdp@apache.org>

@JingsongLi JingsongLi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • scripts/release_licenses.py:125 refers explicitly to jieba-rs-0.10.3.LICENSE, and the README also states that it only covers jieba-rs/jieba-macros 0.10.3; however, correction_html() in scripts/release_licenses.py:387 directly uses this file for any version it resolves.
  • When I constructed metadata using 9.9.9, the script still successfully generated and applied the 0.10.3 license. In the future, when dependencies are upgraded, the license check will not require re-verification, potentially resulting in the silent generation of incorrect legal metadata.
  • It is recommended to add expected versions for each crate to LicenseCorrection and strictly validate them in repository-backed corrections; see the existing BundledComponent.crate_version for reference. (github.com)

@shyjsarah

Copy link
Copy Markdown
Contributor Author

Thanks for catching this. I’ve added explicit expected versions for both jieba-rs and jieba-macros to LicenseCorrection. Repository-backed corrections now validate every resolved crate version before applying the checked-in license and fail explicitly on any mismatch.

I also added a regression test using version 9.9.9, while preserving the existing multi-version behavior for corrections that read licenses from resolved crate sources. Could you please take another look?

@JingsongLi JingsongLi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@JingsongLi
JingsongLi merged commit d607932 into apache:main Jul 23, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants